#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Oct  3 17:37:14 2023

@author: liqingsimac
"""
########################################################
##by wang
import numpy as np
from scipy.integrate import odeint
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D

def lorenz(w,t):
#    sigma=10; rho=28; beta=8/3
    sigma=5; rho=20; beta=3
    x,y,z=w
    return np.array([sigma*(y-x),rho*x-y-x*z,x*y-beta*z])

t=np.arange(0,30,0.01)
solution=odeint(lorenz,[0,1,0],t)

fig=plt.figure()
ax=fig.add_subplot(111, projection='3d')
ax.plot(solution[:,0],solution[:,1],solution[:,2],'b-')
#plt.savefig('mme-4-4.png')
type(fig)    
type(ax)